time and space complexity of merging two sorted arrays